package com.niiwoo.civet.trade.configuration;

import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.DirectExchange;
import org.springframework.amqp.core.Exchange;
import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.niiwoo.civet.trade.constant.RabbitConstant;

/**
 * 智能合同 处理
 * 
 * @author liuchun
 *
 *         2018年11月15日
 */
@Configuration
public class IntelligenceInvestContractEventMqConfiguration {
	// **********************
	// 资金回退
	// **********************
	@Bean
	public Exchange investContractEventExchange() {
		return new DirectExchange(RabbitConstant.Exchange.INTELLIGENCE_INVEST_CONTRACT, true, true);
	}

	@Bean
	public Queue investContractEventQueue() {
		return new Queue(RabbitConstant.Queue.INTELLIGENCE_INVEST_CONTRACT, true);
	}

	@Bean
	public Binding investContractEventBinding() {
		return BindingBuilder.bind(investContractEventQueue()).to(investContractEventExchange()).with(RabbitConstant.RoutingKey.INTELLIGENCE_INVEST_CONTRACT).noargs();
	}
 

}
